﻿//////////////////////////////////////////////////////////////////
//
// IAlmanac.cs
//
// Copyright (c) 2012 Dan Pike.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation files
// (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;

namespace Interfaces
{
   ////////////////////////////////////////////////////////////////////////
   /// <summary>
   /// Encyclopedia of facts about all of the entities in the system
   /// </summary>
   public interface IAlmanac
   {
      ////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// Initialize the almanac by reading and compiling the scripts.
      /// Does not create the objects at this point.
      /// </summary>
      /// <returns>true if everything looks ok</returns>
      bool Initialize();

      ////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// The current game time, held in a single location to ensure that all
      /// systems are working off the same reference
      /// </summary>
      DateTime Now { get; set; }

      ////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// All of the scripts available in the system
      /// </summary>
      IList<IScriptFile> Scripts { get; }

      ////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// All of the planet types available in the system
      /// </summary>
      IList<IPlanetFact> Planets { get; }

      ////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// All of the material types available in the system
      /// </summary>
      IList <IMaterialFact> Materials { get; }

      ////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// All of the producer types available in the system
      /// </summary>
      IList<IProducerFact> Producers { get; }

      ////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// Helper function to get a producer with the given name (saves typing)
      /// </summary>
      IProducerFact FindProducer(string name);

      ////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// Helper function to get a material with the given name (saves typing)
      /// </summary>
      IMaterialFact FindMaterial(string name);
   }
}
